import React, { Component } from 'react'
import style from './main.css'
const typeobj={
    "D3":"中文3D",
    "D3MAX":'MAX3D',
    "NEW":"新"
}

export class Main extends Component {
  render() {
      const {list}=this.props
    return (
      <div>
          {list.length?list.map(item=>{
              return <li key={item.id}>
                  <img src={item.img} alt="" />
                  <div>
                      <h3>{item.title}</h3>
                      <p>
                          <span className={style[item.type]}>{typeobj[item.type]}</span>
                          <button>{item.state === 'purchase' ? '待售' : '购买'}</button>
                      </p>
                  </div>
              </li>
          }):'暂无影片'}
      </div>
    )
  }
}

export default Main